//***************************************************************
//  pp85.java   Author:20172330
//
//
//***************************************************************

import java.util.Scanner;
public class PP85
{
   public static void main(String[] args)
    {
     int num1=0;
     double a=0.0;
     double mean=0.0;
     double c=0.0;
      
     String another;
     Scanner choose = new Scanner(System.in);//定义常量

     int num[]=new int[50];
     for (int number=0;number<50;number++)
      {
       System.out.println("请输入整数");
       num[number]=choose.nextInt();
       num1++;
       another=choose.nextLine();
       
       System.out.println("您是否还要输入整数:y/n");
       another = choose.nextLine();
        if(another.equalsIgnoreCase("n"))
          break;
      }
      
     for(int m=0;m<=num1;m++)
      {
       a+=(double)num[m];
      }  
      
     mean=a/(num1);//计算平均数
     double sd;
     for(int n=0;n<=num1;n++)
      {
       c+= Math.pow(((double)num[n]-mean),2);//计算方差
      }
      
      sd = Math.sqrt(c);
      System.out.println("平均值为："+mean);
      System.out.println("标准方差为："+sd);
    }
}
